/*
 * Copyright 2016-2018 TVI Go Easy.
 * Created on 2018/1/31 18:00
 */
package com.tvi.cloud.organization.security;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;

/**
 * 请在此写下该类的说明
 *
 * @author mechanic
 */
@Configuration
public class ResourceServerConfiguration  extends ResourceServerConfigurerAdapter {
    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/v1/organization/**")

                .hasRole("ADMIN")
                .anyRequest()
                .authenticated();
//        http.authorizeRequests().anyRequest().authenticated();
    }
}
